package com.jason.redCherry.dao.Impl;

import com.jason.redCherry.base.BaseMyBatisDaoSupport;
import com.jason.redCherry.dao.GuestMapper;
import com.jason.redCherry.entity.Guest;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by Jason on 2016/9/5.
 */
@Repository
public class GuestMapperImpl extends BaseMyBatisDaoSupport implements GuestMapper {

    public static String NAME = "com.jason.redCherry.dao.GuestMapper.";

    public int deleteByPrimaryKey(String guestId) {
        return 0;
    }

    public int insert(Guest record) {
        return this.getSqlSession().insert(NAME + "insert", record);
    }

    public Guest selectByPrimaryKey(String guestId) {
        return getSqlSession().selectOne("com.jason.redCherry.dao.GuestMapper.selectByPrimaryKey", guestId);
    }

    public List<Guest> selectAll() {
        return null;
    }

    public int updateByPrimaryKey(Guest record) {
        return this.getSqlSession().update("com.jason.redCherry.dao.GuestMapper.updateByPrimaryKey", record);
    }

    public List<Guest> selectByoWner(String ownerId) {
        return this.getSqlSession().selectList(NAME + "selectByoWner", ownerId);
    }
}
